package z.explorer.ui.component.walker;

import javax.swing.*;

import java.awt.*;

import z.explorer.Main;
import z.explorer.core.storage.dao.OperationDetailDAO;
import z.explorer.ui.component.walker.*;
public class TableMaintain extends JPanel {
	
	private JTabbedPane tabbedPane = new JTabbedPane();
	
	private TableMetadata tableMetadata=new TableMetadata() ;
	public TableMaintain(){
		initUI();
	}
	
	public void initUI(){
		setLayout(new BorderLayout());
		
		tabbedPane.setTabPlacement(JTabbedPane.LEFT);
		
		DetailPanel detail = tableMetadata.getDetailPanel();
		Configuration configuration = tableMetadata.getConfiguration();
		History history = tableMetadata.getHistory();
		
		tabbedPane.add("detail",detail);
		tabbedPane.add("configuration",configuration);
		tabbedPane.add("history",history);
		
		JSplitPane separator = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
		separator.setTopComponent(tableMetadata);
		separator.setBottomComponent(tabbedPane);
		separator.setDividerLocation(0.6);
		separator.setOneTouchExpandable(true);
		separator.setResizeWeight(0.2);
		
		add(separator,BorderLayout.CENTER);
		
		
	}
	
	public static void main(String args[]){
		TableMaintain tableMaintain = new TableMaintain();
		JFrame mainTest = new JFrame("Test");
		Container con = mainTest.getContentPane();
		con.setLayout(new BorderLayout());
		con.add(tableMaintain,BorderLayout.CENTER);
		mainTest.pack();
		mainTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mainTest.setVisible(true);
	}
}
